package com.eiot.framework.demo.enumclass;

public enum ExampleEnum {

    TEST_DATA("test_date", "枚举类测试数据"),
    ;

    private String value;
    private String desc;


    // 构造方法
    private ExampleEnum(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    // 普通方法
    private static String getValue(String desc) {
        for (ExampleEnum u : ExampleEnum.values()) {
            if (u.getDesc() == desc) {
                return u.value;
            }
        }
        return null;
    }

    private static String getDesc(String value) {
        for (ExampleEnum u : ExampleEnum.values()) {
            if (u.getvalue() == value) {
                return u.desc;
            }
        }
        return null;
    }


    public String getvalue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }



}
